package com.oig.auth.api.factory;

import com.oig.auth.api.OpenUserService;
import com.oig.auth.api.fallback.OpenUserServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OpenUserFallbackFactory implements FallbackFactory<OpenUserService> {

    @Override
    public OpenUserService create(Throwable cause) {
        OpenUserServiceFallbackImpl openUserServiceFallBack = new OpenUserServiceFallbackImpl();
        openUserServiceFallBack.setCause(cause);
        return openUserServiceFallBack;
    }

}
